<h1>Channel: <b><%= fmt_escape_html(channel.name) %></b><%= fmt_maybe_vhost(channel.vhost) %></h1>

<div class="section">
<h2>Overview</h2>
<div class="hider updatable">
<% if (rates_mode != 'none') { %>
    <%= message_rates('msg-rates-ch', channel.message_stats) %>
<% } %>

<h3>Details</h3>
<table class="facts facts-l">
  <tr>
    <th>Connection</th>
    <td><%= link_conn(channel.connection_details.name) %></td>
  </tr>
<% if (nodes_interesting) { %>
  <tr>
    <th>Node</th>
    <td><%= fmt_node(channel.node) %></td>
  </tr>
<% } %>
  <tr>
    <th>Username</th>
    <td><%= fmt_string(channel.user) %></td>
  </tr>
  <tr>
    <th>Mode <span class="help" id="channel-mode"></span></th>
    <td><%= fmt_channel_mode(channel) %></td>
  </tr>
</table>

<table class="facts facts-l">
  <tr>
    <th>State</th>
    <td><%= fmt_object_state(channel) %></td>
  </tr>
  <tr>
    <th>Prefetch count</th>
    <td><%= channel.prefetch_count %></td>
  </tr>
  <tr>
    <th>Global prefetch count</th>
    <td><%= channel.global_prefetch_count %></td>
  </tr>
</table>

<table class="facts">
  <tr>
    <th>Messages unacknowledged</th>
    <td><%= channel.messages_unacknowledged %></td>
  </tr>
  <tr>
    <th>Messages unconfirmed</th>
    <td><%= channel.messages_unconfirmed %></td>
  </tr>
  <tr>
    <th>Messages uncommitted</th>
    <td><%= channel.messages_uncommitted %></td>
  </tr>
  <tr>
    <th>Acks uncommitted</th>
    <td><%= channel.acks_uncommitted %></td>
  </tr>
</table>

</div>
</div>

<div class="section">
  <h2>Consumers</h2>
  <div class="hider updatable">
<%= format('consumers', {'mode': 'channel', 'consumers': channel.consumer_details}) %>
  </div>
</div>

<% if (rates_mode == 'detailed') { %>
<div class="section">
<h2>Message rates breakdown</h2>
<div class="hider updatable">
<table class="two-col-layout">
  <tr>
    <td>
      <%= format('msg-detail-publishes',
                 {'mode':   'channel',
                  'object': channel.publishes,
                  'label':  'Publishes'}) %>
    </td>
    <td>
      <%= format('msg-detail-deliveries',
                 {'mode':   'channel',
                  'object': channel.deliveries}) %>
    </td>
  </tr>
</table>
</div>
</div>
<% } %>
